Ternary 三元運算子


Posted by Rich on 2021-04-22

console.log(10 > 5 ? 'bigger' : 'smaller')
output:bigger

condition ? true : false
條件 ? true就執行 : false就執行


#note







Related Posts

[Note] Node.js + express: Server & Routing

[Note] Node.js + express: Server & Routing

Solidity筆記 _ 智能合約基本觀念

Solidity筆記 _ 智能合約基本觀念

我的電腦配單

我的電腦配單


Comments